<template>
	<view class="page">
		<image :src="item" mode="" v-for="(item,index) in data" class="img"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:[]
			}
		},
		onLoad(options) {
			if(options.type == 1) {
				this.render();
			}
			if(options.type == 2) {
				this.render2();
			}
		},
		methods: {
			async render(){
				
				const res = await this.$http({
					url:'api/index/whgj',
					method:"post",
					data:{}
				})
				this.data =res.data;
				// console.log('res',res);
				//console.log(res);
				// if(res.data.length > 0) {
				// 	this.list = res.data;
				// }  else {
				// 	this.list = []
				// }
				
				// console.log(this.list);
			},
			async render2(){
				
				const res = await this.$http({
					url:'api/index/whbl',
					method:"post",
					data:{}
				})
				this.data =res.data;
				// console.log('res',res);
				//console.log(res);
				// if(res.data.length > 0) {
				// 	this.list = res.data;
				// }  else {
				// 	this.list = []
				// }
				
				// console.log(this.list);
			}
		}
	}
</script>
    
<style lang="scss">
 .img {
	 width: 100%;
	 height:1090rpx;
 }
</style>
